<?php 
/**
 * eBay Label Printing Program Printer Model Database Table Class 
 * this is a Db Table Class , It stores printer model Definations
 * It is a storage table, will only have basic functions
 * @package  eBayLabelPrinter
 * @category Models/DbTable
 * @author   Norman Dong <norman.dong@hotmail.com>
 * @version  Initial
 * @copyright LeadCasket.com
 * @link     www.leadcasket.com
 * @license  Commercial
 */
 class Model_DbTable_Assist_PrinterModel extends Zend_Db_Table_Abstract 
{
	/**
	 * @var string Class Table Name
	 */
	protected $_name = 'assist_printer_model'; 
	
	/**
	 * Get printer Model
	 * Really basic function
	 * @param int $idPrinterModel
	 * @return array
	 */	
	
	public function getPrinterModel($idPrinterModel){
		$idPrinterModel = (int) $idPrinterModel;
		
		$row = $this->fetchRow('`id_printer_model` = '.$idPrinterModel);
		if(!$row){
			return false;
		}
		return $row->toArray();		
	}
	
	/**
	 * Get printer Model Name
	 * Really basic function
	 * @param int $idPrinterModel
	 * @return array
	 */	
	
	public function getPrinterModelName($idPrinterModel){
		
		$idPrinterModel = (int) $idPrinterModel;
		
		$row = $this->fetchRow('`id_printer_model` = '.$idPrinterModel);
		if(!$row){
			return false;
		}	
			
		$arrRow = $row->toArray();
		return $arrRow['name_printer_model'];		
	}
	
	/**
	 * List All printer model Name
	 * @return array Two Dimension array
	 */
	
	public function listPrinterModel(){
		$rows = $this->fetchAll('1');
		return $rows->toArray();		
	}
					
}
?>